package com.jinlia.show.modules.base.system.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.jinlia.show.common.core.entity.BaseEntity;
import com.jinlia.show.modules.base.config.DynamicSchemaConfig;
import com.jinlia.show.modules.base.constant.EnableStatusEnum;
import com.jinlia.show.modules.base.constant.LabelEntityEnum;
import com.jinlia.show.modules.base.constant.i.IBaseEnum;
import lombok.Data;

@Data
@TableName(value = "erp_label", schema = DynamicSchemaConfig.schema_system)
public class Label extends BaseEntity {
    @TableId()
    private Long id;

    private Long parentId;
    /**
     * 标签打给谁(枚举 section(部门标签))
     */
    private String entity;
    /**
     * 标签名称
     */
    private String label;
    /**
     * 类型备注
     */
    private String remark;

    @TableField(exist = false)
    private String labelEntityName;
    public void setLabelEntity(String entity) {
        this.entity = entity;
        this.labelEntityName = IBaseEnum.getLabelByValue(entity, LabelEntityEnum.class);
    }
}
